home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / sgelsd.z / sgelsd
Encoding:
Text File  |  2002-10-03  |  7.4 KB  |  199 lines

  1.  
  2.  
  3.  
  4. SSSSGGGGEEEELLLLSSSSDDDD((((3333SSSS))))                                                          SSSSGGGGEEEELLLLSSSSDDDD((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SGELSD - compute the minimum-norm solution to a real linear least squares
  10.      problem
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE SGELSD( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,
  14.                         LWORK, IWORK, INFO )
  15.  
  16.          INTEGER        INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
  17.  
  18.          REAL           RCOND
  19.  
  20.          INTEGER        IWORK( * )
  21.  
  22.          REAL           A( LDA, * ), B( LDB, * ), S( * ), WORK( * )
  23.  
  24. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  25.      These routines are part of the SCSL Scientific Library and can be loaded
  26.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  27.      directs the linker to use the multi-processor version of the library.
  28.  
  29.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  30.      4 bytes (32 bits). Another version of SCSL is available in which integers
  31.      are 8 bytes (64 bits).  This version allows the user access to larger
  32.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  33.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  34.      only one of the two versions; 4-byte integer and 8-byte integer library
  35.      calls cannot be mixed.
  36.  
  37. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  38.      SGELSD computes the minimum-norm solution to a real linear least squares
  39.      problem:     minimize 2-norm(| b - A*x |)
  40.      using the singular value decomposition (SVD) of A. A is an M-by-N matrix
  41.      which may be rank-deficient.
  42.  
  43.      Several right hand side vectors b and solution vectors x can be handled
  44.      in a single call; they are stored as the columns of the M-by-NRHS right
  45.      hand side matrix B and the N-by-NRHS solution matrix X.
  46.  
  47.      The problem is solved in three steps:
  48.      (1) Reduce the coefficient matrix A to bidiagonal form with
  49.          Householder transformations, reducing the original problem
  50.          into a "bidiagonal least squares problem" (BLS)
  51.      (2) Solve the BLS using a divide and conquer approach.
  52.      (3) Apply back all the Householder tranformations to solve
  53.          the original least squares problem.
  54.  
  55.      The effective rank of A is determined by treating as zero those singular
  56.      values which are less than RCOND times the largest singular value.
  57.  
  58.      The divide and conquer algorithm makes very mild assumptions about
  59.      floating point arithmetic. It will work on machines with a guard digit in
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSGGGGEEEELLLLSSSSDDDD((((3333SSSS))))                                                          SSSSGGGGEEEELLLLSSSSDDDD((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      add/subtract, or on those binary machines without guard digits which
  75.      subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could
  76.      conceivably fail on hexadecimal or decimal machines without guard digits,
  77.      but we know of none.
  78.  
  79.  
  80. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  81.      M       (input) INTEGER
  82.              The number of rows of A. M >= 0.
  83.  
  84.      N       (input) INTEGER
  85.              The number of columns of A. N >= 0.
  86.  
  87.      NRHS    (input) INTEGER
  88.              The number of right hand sides, i.e., the number of columns of
  89.              the matrices B and X. NRHS >= 0.
  90.  
  91.      A       (input) REAL array, dimension (LDA,N)
  92.              On entry, the M-by-N matrix A.  On exit, A has been destroyed.
  93.  
  94.      LDA     (input) INTEGER
  95.              The leading dimension of the array A.  LDA >= max(1,M).
  96.  
  97.      B       (input/output) REAL array, dimension (LDB,NRHS)
  98.              On entry, the M-by-NRHS right hand side matrix B.  On exit, B is
  99.              overwritten by the N-by-NRHS solution matrix X.  If m >= n and
  100.              RANK = n, the residual sum-of-squares for the solution in the i-
  101.              th column is given by the sum of squares of elements n+1:m in
  102.              that column.
  103.  
  104.      LDB     (input) INTEGER
  105.              The leading dimension of the array B. LDB >= max(1,max(M,N)).
  106.  
  107.      S       (output) REAL array, dimension (min(M,N))
  108.              The singular values of A in decreasing order.  The condition
  109.              number of A in the 2-norm = S(1)/S(min(m,n)).
  110.  
  111.      RCOND   (input) REAL
  112.              RCOND is used to determine the effective rank of A.  Singular
  113.              values S(i) <= RCOND*S(1) are treated as zero.  If RCOND < 0,
  114.              machine precision is used instead.
  115.  
  116.      RANK    (output) INTEGER
  117.              The effective rank of A, i.e., the number of singular values
  118.              which are greater than RCOND*S(1).
  119.  
  120.      WORK    (workspace/output) REAL array, dimension (LWORK)
  121.              On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  122.  
  123.      LWORK   (input) INTEGER
  124.              The dimension of the array WORK. LWORK must be at least 1.  The
  125.              exact minimum amount of workspace needed depends on M, N and
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSGGGGEEEELLLLSSSSDDDD((((3333SSSS))))                                                          SSSSGGGGEEEELLLLSSSSDDDD((((3333SSSS))))
  137.  
  138.  
  139.  
  140.              NRHS. As long as LWORK is at least 12*N + 2*N*SMLSIZ + 8*N*NLVL +
  141.              N*NRHS + (SMLSIZ+1)**2, if M is greater than or equal to N or
  142.              12*M + 2*M*SMLSIZ + 8*M*NLVL + M*NRHS + (SMLSIZ+1)**2, if M is
  143.              less than N, the code will execute correctly.  SMLSIZ is returned
  144.              by ILAENV and is equal to the maximum size of the subproblems at
  145.              the bottom of the computation tree (usually about 25), and NLVL =
  146.              MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 ) For good
  147.              performance, LWORK should generally be larger.
  148.  
  149.              If LWORK = -1, then a workspace query is assumed; the routine
  150.              only calculates the optimal size of the WORK array, returns this
  151.              value as the first entry of the WORK array, and no error message
  152.              related to LWORK is issued by XERBLA.
  153.  
  154.      IWORK   (workspace) INTEGER array, dimension (LIWORK)
  155.              LIWORK >= 3 * MINMN * NLVL + 11 * MINMN, where MINMN = MIN( M,N
  156.              ).
  157.  
  158.      INFO    (output) INTEGER
  159.              = 0:  successful exit
  160.              < 0:  if INFO = -i, the i-th argument had an illegal value.
  161.              > 0:  the algorithm for computing the SVD failed to converge; if
  162.              INFO = i, i off-diagonal elements of an intermediate bidiagonal
  163.              form did not converge to zero.
  164.  
  165. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  166.      Based on contributions by
  167.         Ming Gu and Ren-Cang Li, Computer Science Division, University of
  168.           California at Berkeley, USA
  169.         Osni Marques, LBNL/NERSC, USA
  170.  
  171.  
  172. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  173.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  174.  
  175.      This man page is available only online.
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.